Aws
Auth
Axios
Admin
Angular
Android
Atom Payment
BPO
BcryptJs
Bootstrap
Basic Computer
C Language
C++
Css
Canva
Common questions
CorelDraw
Cloudinary
Content Writer
DSA
Django
Error
Excel
ExpressJs
Flutter
Github
Graphql
GoDaddy
HR
Html5
Hostinger
Jwt
Java
Json
Jquery
Javascript
Linux OS
Loopback API
MySQL
Manager
MongoDB
Marketing
MS Office
Mongoose
NodeJs
NextJs
Php
Python
Photoshop
PostgreSQL
PayU Payment
Paypal Payment
Redux
ReactJs
Router
React Native
React Router Dom
React Helmet
Sass
SEO
SMO
Stripe Payment
System Administrator
Software Testing
Typescript
Tailwind
Telesales
Tally
VueJs
Windows OS
XML
Javascript
#iuqz0P
What is the `Object.freeze` method in JavaScript?
Description : `Object.freeze` prevents modifications to an object.
Answer :
`Object.freeze` is used to make an object immutable by preventing new properties from being added, existing properties from being removed or altered, and marking all properties as read-only. It effectively locks the object from any modifications. const obj = { a: 1 }; Object.freeze(obj); obj.a = 2; console.log(obj.a); // 1
Category : Javascript
Created Date : 9/6/2024
Show more answersWrite your answer
Related Questions
Total : 353Paid :276Free :77Page :4
What is the `String.prototype.anchor` method in JavaScript?
More detailsWhat is the `String.prototype.anchor` method in JavaScript?
2024-09-06 last updatedFreeJavascript
`String.prototype.anchor` creates an HTML `<a>` element wrapping the string with a specified name attribute. This method is deprecated and should not be used in modern applications. const str = 'Click here'; const anchoredStr = str.anchor('top'); console.log(anchoredStr); // '<a name="top">Click here</a>'
`String.prototype.anchor` creates an HTML `<a>` element wrapping the string with a specified name attribute. This method is deprecated and should not be used in modern applications. const str = 'Click here'; const anchoredStr = str.anchor('top'); console.log(anchoredStr); // '<a name="top">Click here</a>'
What is the `String.prototype.small` method in JavaScript?
More detailsWhat is the `String.prototype.small` method in JavaScript?
2024-09-06 last updatedFreeJavascript
`String.prototype.small` returns a string wrapped in HTML `<small>` tags. This method is deprecated and should not be used in modern applications. const str = 'hello'; const smallStr = str.small(); console.log(smallStr); // '<small>hello</small>'
`String.prototype.small` returns a string wrapped in HTML `<small>` tags. This method is deprecated and should not be used in modern applications. const str = 'hello'; const smallStr = str.small(); console.log(smallStr); // '<small>hello</small>'